/*    */ package com.wgcloud.controller;
/*    */ 
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.LogInfo;
/*    */ import com.wgcloud.service.LogInfoService;
/*    */ import com.wgcloud.util.PageUtil;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import javax.annotation.Resource;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import org.apache.commons.lang3.StringUtils;
/*    */ import org.slf4j.Logger;
/*    */ import org.slf4j.LoggerFactory;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.ui.Model;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Controller
/*    */ @RequestMapping({"/log"})
/*    */ public class LogInfoController
/*    */ {
/* 32 */   private static final Logger logger = LoggerFactory.getLogger(com.wgcloud.controller.LogInfoController.class);
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   @Resource
/*    */   private LogInfoService logInfoService;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   @RequestMapping({"list"})
/*    */   public String LogInfoList(LogInfo logInfo, Model model) {
/* 46 */     Map<String, Object> params = new HashMap<>();
/*    */     try {
/* 48 */       StringBuffer url = new StringBuffer();
/* 49 */       String hostname = null;
/* 50 */       if (!StringUtils.isEmpty(logInfo.getHostname())) {
/* 51 */         hostname = logInfo.getHostname();
/* 52 */         params.put("hostname", hostname.trim());
/* 53 */         url.append("&hostname=").append(hostname);
/*    */       } 
/* 55 */       PageInfo pageInfo = this.logInfoService.selectByParams(params, logInfo.getPage().intValue(), logInfo.getPageSize().intValue());
/* 56 */       PageUtil.initPageNumber(pageInfo, model);
/*    */       
/* 58 */       model.addAttribute("pageUrl", "/log/list?1=1" + url.toString());
/* 59 */       model.addAttribute("page", pageInfo);
/* 60 */       model.addAttribute("logInfo", logInfo);
/* 61 */     } catch (Exception e) {
/* 62 */       logger.error("查询日志列表错误", e);
/*    */     } 
/* 64 */     return "log/list";
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   @RequestMapping({"view"})
/*    */   public String viewLogInfo(Model model, HttpServletRequest request) {
/* 77 */     String id = request.getParameter("id");
/*    */     
/*    */     try {
/* 80 */       LogInfo logInfo = this.logInfoService.selectById(id);
/* 81 */       model.addAttribute("logInfo", logInfo);
/* 82 */     } catch (Exception e) {
/* 83 */       logger.error("查看日志信息错误", e);
/*    */     } 
/* 85 */     return "log/view";
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/controller/LogInfoController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */